package org.gugy.blogcode.poiDealExcel.controller;

import org.gugy.blogcode.poiDealExcel.service.ExcelService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 辜光宇
 * 2021/6/10 11:39
 */
@RestController
@RequestMapping("/excel")
public class ExcelController {

    @Resource
    private ExcelService excelService;

    @PostMapping("/dealFromFile")
    public List<Object> dealFromFile(MultipartFile file) {
        return excelService.dealFromFile(file);
    }

    @PostMapping("/dealFromUri")
    public List<Object> dealFromUri(String fileUri) {
        return excelService.dealFromUri(fileUri);
    }
}
